#ifndef NR_OBJECT_LINK_H
#define NR_OBJECT_LINK_H

#include "nr_object.h"
#include "nr_permission.h"

class nr_object_link : public nr_object,  public nr_permissionable
{
public:
    typedef QHash<nr_object_id_t, nr_object_link*> nr_object_link_hash; 
    
    typedef enum nr_item_link_type_enum
    {
        NR_ITEM_LINK_TYPE_NONE = 0, 
        NR_ITEM_LINK_TYPE_DEVICE,
        NR_ITEM_LINK_TYPE_GROUP,
        NR_ITEM_LINK_TYPE_SERVER,
    }nr_object_link_type_t;
    
    nr_object_link(void) : m_type(NR_ITEM_LINK_TYPE_NONE)
    {
    }
    
    nr_object_link(nr_object_link_type_t type) : m_type(type)
    {
    }
    
    ~nr_object_link(void);
    
    nr_object_link_type_t type() { return m_type; }

    nr_object_id_t& id();

    nr_object_link_hash& links() { return m_links; }

protected:
    nr_object_link_type_t m_type;
    nr_object_id_t m_id;
    nr_object_link_hash m_links;
};

typedef nr_object_link::nr_object_link_hash nr_object_links;

#endif